2022-05-09 19:46:06,430 INFO: Microblog startup [in C:\data\mymicroblog\app\__init__.py:71]
2022-05-09 19:47:17,457 ERROR: Exception on /edit_profile [POST] [in C:\Users\user\miniconda3\envs\microblog\lib\site-packages\flask\app.py:1455]
Traceback (most recent call last):
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\sqlalchemy\engine\base.py", line 1819, in _execute_context
    self.dialect.do_execute(
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\sqlalchemy\engine\default.py", line 732, in do_execute
    cursor.execute(statement, parameters)
sqlite3.IntegrityError: UNIQUE constraint failed: user.username

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\flask\app.py", line 2077, in wsgi_app
    response = self.full_dispatch_request()
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\flask\app.py", line 1525, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\flask\app.py", line 1523, in full_dispatch_request
    rv = self.dispatch_request()
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\flask\app.py", line 1509, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\flask_login\utils.py", line 277, in decorated_view
    return current_app.ensure_sync(func)(*args, **kwargs)
  File "C:\data\mymicroblog\app\routes.py", line 208, in edit_profile
    db.session.commit()
  File "<string>", line 2, in commit
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\sqlalchemy\orm\session.py", line 1435, in commit
    self._transaction.commit(_to_root=self.future)
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\sqlalchemy\orm\session.py", line 829, in commit
    self._prepare_impl()
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\sqlalchemy\orm\session.py", line 808, in _prepare_impl
    self.session.flush()
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\sqlalchemy\orm\session.py", line 3367, in flush
    self._flush(objects)
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\sqlalchemy\orm\session.py", line 3507, in _flush
    transaction.rollback(_capture_exception=True)
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\sqlalchemy\util\langhelpers.py", line 70, in __exit__
    compat.raise_(
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\sqlalchemy\util\compat.py", line 207, in raise_
    raise exception
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\sqlalchemy\orm\session.py", line 3467, in _flush
    flush_context.execute()
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\sqlalchemy\orm\unitofwork.py", line 456, in execute
    rec.execute(self)
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\sqlalchemy\orm\unitofwork.py", line 630, in execute
    util.preloaded.orm_persistence.save_obj(
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\sqlalchemy\orm\persistence.py", line 237, in save_obj
    _emit_update_statements(
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\sqlalchemy\orm\persistence.py", line 1001, in _emit_update_statements
    c = connection._execute_20(
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\sqlalchemy\engine\base.py", line 1631, in _execute_20
    return meth(self, args_10style, kwargs_10style, execution_options)
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\sqlalchemy\sql\elements.py", line 325, in _execute_on_connection
    return connection._execute_clauseelement(
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\sqlalchemy\engine\base.py", line 1498, in _execute_clauseelement
    ret = self._execute_context(
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\sqlalchemy\engine\base.py", line 1862, in _execute_context
    self._handle_dbapi_exception(
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\sqlalchemy\engine\base.py", line 2043, in _handle_dbapi_exception
    util.raise_(
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\sqlalchemy\util\compat.py", line 207, in raise_
    raise exception
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\sqlalchemy\engine\base.py", line 1819, in _execute_context
    self.dialect.do_execute(
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\sqlalchemy\engine\default.py", line 732, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.IntegrityError: (sqlite3.IntegrityError) UNIQUE constraint failed: user.username
[SQL: UPDATE user SET username=?, about_me=? WHERE user.id = ?]
[parameters: ('zhang', 'bbbb', 2)]
(Background on this error at: https://sqlalche.me/e/14/gkpj)
2022-05-09 20:24:57,992 INFO: Microblog startup [in C:\data\mymicroblog\app\__init__.py:71]
2022-05-10 01:53:39,727 INFO: Microblog startup [in C:\data\mymicroblog\app\__init__.py:71]
2022-05-10 01:54:00,711 INFO: Microblog startup [in C:\data\mymicroblog\app\__init__.py:71]
2022-05-10 05:31:34,477 INFO: Microblog startup [in C:\data\mymicroblog\app\__init__.py:71]
2022-05-10 06:55:39,827 INFO: Microblog startup [in C:\data\mymicroblog\app\__init__.py:71]
2022-05-10 06:56:52,677 ERROR: Exception on /user/zhang [GET] [in C:\Users\user\miniconda3\envs\microblog\lib\site-packages\flask\app.py:1455]
Traceback (most recent call last):
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\flask\app.py", line 2077, in wsgi_app
    response = self.full_dispatch_request()
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\flask\app.py", line 1525, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\flask\app.py", line 1523, in full_dispatch_request
    rv = self.dispatch_request()
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\flask\app.py", line 1509, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\flask_login\utils.py", line 277, in decorated_view
    return current_app.ensure_sync(func)(*args, **kwargs)
  File "C:\data\mymicroblog\app\routes.py", line 203, in user
    return render_template('user.html', user=user, posts=posts, form=form)
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\flask\templating.py", line 148, in render_template
    return _render(
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\flask\templating.py", line 128, in _render
    rv = template.render(context)
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\jinja2\environment.py", line 1291, in render
    self.environment.handle_exception()
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\jinja2\environment.py", line 926, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "C:\data\mymicroblog\app\templates\user.html", line 1, in top-level template code
    {% extends "base.html" %}
  File "C:\data\mymicroblog\app\templates\base.html", line 38, in top-level template code
    {% block content %}{% endblock %}
  File "C:\data\mymicroblog\app\templates\user.html", line 21, in block 'content'
    {{ form.hidden_tag() }}
TypeError: hidden_tag() missing 1 required positional argument: 'self'
2022-05-10 06:58:07,178 ERROR: Exception on /user/zhang [GET] [in C:\Users\user\miniconda3\envs\microblog\lib\site-packages\flask\app.py:1455]
Traceback (most recent call last):
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\flask\app.py", line 2077, in wsgi_app
    response = self.full_dispatch_request()
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\flask\app.py", line 1525, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\flask\app.py", line 1523, in full_dispatch_request
    rv = self.dispatch_request()
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\flask\app.py", line 1509, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\flask_login\utils.py", line 277, in decorated_view
    return current_app.ensure_sync(func)(*args, **kwargs)
  File "C:\data\mymicroblog\app\routes.py", line 203, in user
    return render_template('user.html', user=user, posts=posts, form=form)
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\flask\templating.py", line 148, in render_template
    return _render(
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\flask\templating.py", line 128, in _render
    rv = template.render(context)
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\jinja2\environment.py", line 1291, in render
    self.environment.handle_exception()
  File "C:\Users\user\miniconda3\envs\microblog\lib\site-packages\jinja2\environment.py", line 926, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "C:\data\mymicroblog\app\templates\user.html", line 1, in top-level template code
    {% extends "base.html" %}
  File "C:\data\mymicroblog\app\templates\base.html", line 38, in top-level template code
    {% block content %}{% endblock %}
  File "C:\data\mymicroblog\app\templates\user.html", line 21, in block 'content'
    {{ form.hidden_tag() }}
TypeError: hidden_tag() missing 1 required positional argument: 'self'
2022-05-10 07:00:38,498 INFO: Microblog startup [in C:\data\mymicroblog\app\__init__.py:71]
